package org.sems.sems.Mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.sems.sems.entity.Dcwjhdk;

import java.util.List;

@Mapper
public interface DcwjhdkMapper {

    int insertDcwjhdk(Dcwjhdk dcwjhdk);

    @Select("SELECT * FROM dcwjhdk WHERE ID = #{dcwjid}")
    Dcwjhdk getDcwjhdkByDcwjid(int dcwjid);

    @Select("select * FROM dcwjhdk WHERE ExamId in " +
            "(select DCWJK.ID  from DCWJK where DCWJK.FBZ in " +
            "(select  JSDMK.DLZH from JSDMK where JSDMK.ID in(select JSID from JSBJDYK where BJID =(" +
            "select SSBJ from DATA_STUDENT where YHM = #{yhm})) ))")
    List<Dcwjhdk> getDcwjhdkByYhmStudent(String yhm);

    @Select("select * FROM dcwjhdk WHERE ExamId in " +
            "(select DCWJK.ID  from DCWJK where DCWJK.FBZ in " +
            "(select  JSDMK.DLZH from JSDMK where JSDMK.DLZH = #{yhm} ))")
    List<Dcwjhdk> getDcwjhdkByYhmTeacher(String yhm);// 老师获取学生的调查问卷回答
}
